-
Notifications
You must be signed in to change notification settings - Fork 210
chore: Add module examples to User Management Guide and apply consistency in docs #4048
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: Add module examples to User Management Guide and apply consistency in docs #4048
Conversation
02f70c4 to
a4932fc
Compare
… favor of links to examples
|
APIx bot: a message has been sent to Docs Slack channel |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR consolidates migration documentation and adds comprehensive module examples across all User Management migration paths, following the pattern established in PR #4045.
Changes:
- Adds
module_maintainer/andmodule_user/migration examples (v1→v2→v3) for four migration guides - Restructures example directories with
basic/,module_maintainer/, andmodule_user/subdirectories - Consolidates version-specific READMEs in basic examples into single parent READMEs for better maintainability
Reviewed changes
Copilot reviewed 78 out of 115 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| examples/migrate_team_project_assignment/v2/README.md | Removed standalone README (content moved to basic/README.md) |
| examples/migrate_team_project_assignment/module_user/* | Added module consumer migration examples (v1-v3) |
| examples/migrate_team_project_assignment/module_maintainer/* | Added module developer migration examples (v1-v3) |
| examples/migrate_team_project_assignment/basic/* | Updated to consolidate README and adjust main.tf |
| examples/migrate_team_project_assignment/README.md | Updated to reference restructured subdirectories |
| examples/migrate_project_invitation_to_cloud_user_project_assignment/v2/README.md | Removed standalone README (content moved to basic/README.md) |
| examples/migrate_project_invitation_to_cloud_user_project_assignment/v3/README.md | Removed standalone README (content moved to basic/README.md) |
| examples/migrate_project_invitation_to_cloud_user_project_assignment/module_user/* | Added module consumer migration examples (v1-v3) |
| examples/migrate_project_invitation_to_cloud_user_project_assignment/module_maintainer/* | Added module developer migration examples (v1-v3) |
| examples/migrate_project_invitation_to_cloud_user_project_assignment/basic/README.md | Consolidated version-specific READMEs into single parent README |
| examples/migrate_project_invitation_to_cloud_user_project_assignment/README.md | Updated to reference restructured subdirectories |
| examples/migrate_atlas_user_and_atlas_users/v2/README.md | Removed standalone README (content moved to basic/README.md) |
| examples/migrate_atlas_user_and_atlas_users/v3/README.md | Removed standalone README (content moved to basic/README.md) |
| examples/migrate_atlas_user_and_atlas_users/module_user/* | Added module consumer migration examples (v1-v3) |
| examples/migrate_atlas_user_and_atlas_users/module_maintainer/* | Added module developer migration examples (v1-v3) |
| examples/migrate_atlas_user_and_atlas_users/basic/README.md | Consolidated version-specific READMEs into single parent README |
| examples/migrate_atlas_user_and_atlas_users/README.md | Updated to reference restructured subdirectories |
| docs/guides/atlas-user-management.md | Updated to reference new module examples and simplify documentation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
erabil-mdb
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! + a few super small suggestions
| ## Usage | ||
|
|
||
| 1. Start with v1 to understand the original setup | ||
| 2. Apply v2 to validate new data sources return expected data |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 2. Apply v2 to validate new data sources return expected data | |
| 2. Apply v2 to validate that new data sources return expected data |
| @@ -0,0 +1,27 @@ | |||
| # Module Maintainer Migration Example | |||
|
|
|||
| This example demonstrates how module maintainers should migrate from `mongodbatlas_atlas_user` data source to `mongodbatlas_cloud_user_org_assignment`. | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| This example demonstrates how module maintainers should migrate from `mongodbatlas_atlas_user` data source to `mongodbatlas_cloud_user_org_assignment`. | |
| This example demonstrates how module maintainers should migrate from the `mongodbatlas_atlas_user` data source to `mongodbatlas_cloud_user_org_assignment`. |
| ## v1: Initial State | ||
|
|
||
| Module using the deprecated `mongodbatlas_atlas_user` data source: | ||
| - Complex role filtering with for expressions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| - Complex role filtering with for expressions | |
| - Complex role filtering with `for` expressions |
marcosuma
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - one minor comment on the urls for the examples on github (usage of master vs the fixed tag)
| - Replace the deprecated `usernames` attribute with `mongodbatlas_cloud_user_team_assignment` resources inside the module. | ||
| - Terraform doesn't allow import blocks in modules ([Terraform issue](https://github.com/hashicorp/terraform/issues/33474)). Document the import ID format for users: `org_id/team_id/user_id` (or `org_id/team_id/username`). | ||
| - Publish a new module version. | ||
| - See [module_maintainer example](https://github.com/mongodb/terraform-provider-mongodbatlas/tree/master/examples/migrate_user_team_assignment/module_maintainer) for complete implementation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
similar to the ask in the other PR, you're using master instead of a version tag (like in the code you removed just below here). Is this intentional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is intentional yes. I synced with Espen about this topic and left a follow-up comment in the other PR clarifying, but in summary, it's safe to leave master, as when the release happens this script that we have replaces all master tags with the fixed release version.
EspenAlbert
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I checked the team_project_assignment. And I have the feeling the existing code blocks could be replaced with a link to the basic example.
Also, note how the basic example uses a hardcoded this for the project_name, I don't think that is intentional?
EspenAlbert
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job on adding all these, but IMO we now have duplicate basic examples and the code snippets shown in atlas-user-management.md
I would refactor to remove the code snippets from the management guide and instead link to the basic examples.
For the Module considerations and Notes/FAQ I also have the feeling that this could stay in the examples/*/README.md files OR stay in the guide and we link from the README's.
|
As we have now duplicate basic examples and code snippets for the migration guide, it's worth reconsidering if we want to keep duplication in the docs. Bringing this point to our tech sync to get team alignment and if needed, a follow-up PR will be created. |
…ency in docs (#4048) * Bundle basic resource migration into basic directory * Maintain previous structrue for main file * Add module_user example * Add module_maintainer example * Add example links to migration guide docs * Minor fixes * Bundle example into basic directory * Add module_maintainer example * Add module_user example * Add links to examples on Migration Guide * Add main README and refine docs * Rebundle Atlas user basic example and add example modules * Remove extra verbose module example for cloud user team assignment in favor of links to examples * bundle README files from migration example into a single one for better readability * Rebundle project invitation READMEs into singular one for better readability * Address PR comments * Replace this hardcoded value with project_name variable
Description
This PR consolidates and adds module examples across all migration paths in the User Management migration guide. It is a follow-up to PR #4045, using the
Org Invitation → Cloud User Org Assignmentmigration as the reference pattern for consistency.Module Examples Added
The following migration guides now include
module_maintainer/andmodule_user/examples (v1 → v2 → v3):mongodbatlas_org_invitation→mongodbatlas_cloud_user_org_assignmentmongodbatlas_project.teams→mongodbatlas_team_project_assignmentmongodbatlas_project_invitation→mongodbatlas_cloud_user_project_assignmentdata.mongodbatlas_atlas_user→data.mongodbatlas_cloud_user_org_assignmentdata.mongodbatlas_atlas_users→mongodbatlas_organization.users/mongodbatlas_project.users/mongodbatlas_team.usersDocumentation Improvements
Example Directory RestructuringMigration examples have been reorganized into the following structure:
basic/- Direct resource usage examples with consolidated READMEmodule_maintainer/- Module developer migration examplesmodule_user/- Module consumer migration examplesREADME.md- Overview with links to all subdirectoriesBasic Example README Consolidation
The following
basic/directories had their version-specific READMEs consolidated into a single parent README for better maintainability:migrate_atlas_user_and_atlas_users/basic/v2/README.mdandv3/README.mdintobasic/README.mdmigrate_project_invitation_to_cloud_user_project_assignment/basic/v2/README.mdandv3/README.mdintobasic/README.mdEach consolidated README now documents all migration phases (v1 → v2 → v3) with key attribute changes, usage steps, and expected behavior in a single location.
Link to any related issue(s): CLOUDP-344329
Type of change:
Required Checklist:
Further comments